package com.credithc.customers.manager.schedule;

import com.credithc.customers.manager.service.ScheduleService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Date;

/***
 * @description: 每日各系统注册数统计
 * @author: fby
 * @date: 2020/6/9 13:48
 * @param: null
 * @return:
 */

@Slf4j
public class StatsLoginFlowJob implements Job {

    @Autowired
    private ScheduleService scheduleService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("=========================================开始统计产品各系统注册数=========================================");
        String currentDay = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        scheduleService.statsLoginFlow(currentDay);
    }
}
